#include <iostream>
using namespace std;

int main() {
    int n;
    while (cin >> n) {
        int k = 0;
        int total_days = 0;

        // 找到最大整数 k，使得 1+2+...+k ≤ n
        while (total_days + k + 1 <= n) {
            ++k;
            total_days += k;
        }
        //经典的平方和公式
        long long full_coins = (long long)k * (k + 1) * (2 * k + 1) / 6;

        // 剩余天数
        int remaining_days = n - total_days;
        long long remaining_coins = (long long)remaining_days * (k + 1);

        // 输出结果
        cout << n << " " << full_coins + remaining_coins << endl;
    }

    return 0;
}